]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
notificationDaemon: Fix auto-closing FDO notifications
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 20 Feb 2024 18:46:19 +0000 (19:46 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 20 Feb 2024 20:09:32 +0000 (21:09 +0100)
We auto-close FDO notifications when the sender leaves the bus,
given that the protocol was created without persistency in mind
and any action will become invalid.

However that broke when moving the public-facing implementation
into a separate service, as we now track the (always running)
service instead of the original sender.

Fix that by forwarding the sender to the internal implementation
via a private hint, just like we already do for the PID.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3204>

js/dbusServices/notifications/notificationDaemon.js
js/ui/notificationDaemon.js

index 473b0c4c03c4be9c393eda7fba245bb231dfaf56..38ad9118f259ed86002486d420861aa6a9b7146b 100644 (file)
@@ -101,6 +101,7 @@ export const NotificationDaemon = class extends ServiceImplementation {
         params[6] = {
             ...hints,
             'x-shell-sender-pid': new GLib.Variant('u', pid),
+            'x-shell-sender': new GLib.Variant('s', sender),
         };
 
         try {
index 4c6437a8cf2569b0c9f908f71e780ec0698e1c0b..d6aa3811c4c8275c0fa04d2b62f6d34ed623bf6b 100644 (file)
@@ -161,7 +161,7 @@ class FdoNotificationDaemon {
         }
         this._notifications[id] = ndata;
 
-        let sender = invocation.get_sender();
+        const sender = hints['x-shell-sender'];
         const pid = hints['x-shell-sender-pid'];
 
         let source = this._getSource(appName, pid, ndata, sender, null);